package nowcoder.duoduo4;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        List<Integer> l = new ArrayList<>();
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()){
            l.add(sc.nextInt());
        }
        System.out.println(getMax(l));
    }

    private static long getMax(List<Integer> nums){
        long result = 0L;
        long a = 0, b = 0;
        boolean flag = true;
        for(int i = nums.size()-1; i >= 0; i--){
            while (nums.get(i) != 0){
                if(flag){
                    a = a*10+i;
                    flag = false;
                }else {
                    b = b*10+i;
                    flag = true;
                }
                nums.set(i, nums.get(i)-1);
            }
        }
        return a*b;
    }

}
